package com.acme.bankapp.domain.bank;

/**
 * Constructor expects nonNegative balance
 * @author Java Student
 *
 */
public abstract class AbstractAccount {

	protected double balance;

	public AbstractAccount(double balance) throws IllegalArgumentException {
		if (balance < 0)
			throw new IllegalArgumentException("Negative balance");
		this.balance = balance;
	}

	public double getBalance() {
		return this.balance;
	}

	public void deposite(double amount) {
		this.balance += amount;
	}

}